package com.frejoys.service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.frejoys.dao.entity.VoiceMessage;

public interface VoiceMessageService extends IService<VoiceMessage> {

    default VoiceMessage getOnly(QueryWrapper<VoiceMessage> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default VoiceMessage getOnly(LambdaQueryWrapper<VoiceMessage> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    /**
     * 添加并返回信息
     * @param storeCode 店铺code
     * @param orderSn 订单编号
     * @return
     */
    VoiceMessage saveInfo(Long storeCode, Long orderSn);

    // 语音播报
    void voicePlay(Long orderSn);

}
